<extend name="Public/base"/>
<block name="content">
    <div class="admin-content">
        <div class="admin-content-body">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">提币管理</strong>  <small></small></div>
            </div>

            <hr>

            <form class="am-g" action="{:U()}" method="get">
                <select data-am-selected="{btnSize: 'sm'}" name="status">
                    <option value="0" <php>if($status == "") echo 'selected'</php>>全部</option>
                    <option value="2" <php>if($status == 2) echo 'selected'</php>>待审核</option>
                    <option value="1" <php>if($status == 1) echo 'selected'</php>>已完成</option>
                    <option value="3" <php>if($status == 3) echo 'selected'</php>>已驳回</option>
                </select>

                <div class="am-u-sm-12 am-u-md-2">
                    <div class="am-input-group am-input-group-sm">
                        <input type="text" class="am-form-field" name="username" value="{$username}" placeholder="会员用户名">
                    </div>
                </div>

                <div class="am-u-sm-12 am-u-md-2">
                    <div class="am-input-group am-input-group-sm">
                        <select name="coinname" id="">
                            <option value="" <if condition="$coinname eq ''">selected</if>>提币币种</option>
                            <option value="1" <if condition="$coinname eq 1">selected</if>>EXUU</option>
                            <option value="8" <if condition="$coinname eq 8">selected</if>>USDT</option>
                            <option value="10" <if condition="$coinname eq 10">selected</if>>USDT-OMNI</option>
                        </select>
                    </div>
                </div>
                <!--<input type="text" class="" name="phone" value="{$phone}"  placeholder="手机号查询">-->
                <input type="text" class="" name="address" value="{$address}"  placeholder="提币地址查询" style="width: 400px">
                <button class="am-btn am-btn-primary" type="submit">搜索</button>
                <!-- <div class="am-u-sm-12 am-u-md-1">
                  <div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs">
                      <a href="{:U('user/exportOrder')}" type="button" class="am-btn am-btn-primary"><span class="am-icon-plus"></span>提现未处理</a>
                    </div>
                  </div>

                </div>
                <div class="am-u-sm-12 am-u-md-1">
                  <div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs">
                      <a href="{:U('user/exportOrder1')}" type="button" class="am-btn am-btn-primary"><span class="am-icon-plus"></span>提现已处理</a>
                    </div>
                  </div>

                </div> -->
                <!--   <div class="am-u-sm-12 am-u-md-2">
                    <input type="text" class="am-form-field" name="start_time"  value="{$start_time}" placeholder="开始时间" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',readOnly:true})" readonly/>
                  </div>
                  <div class="am-u-sm-12 am-u-md-2">
                    <input type="text" class="am-form-field" name="end_time"  value="{$end_time}" placeholder="结束时间" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',readOnly:true})" readonly/>
                  </div>
                  <div class="am-u-sm-12 am-u-md-2">
                    <div class="am-input-group am-input-group-sm">
                      <input type="text" class="am-form-field" name="username" value="{$username}" placeholder="会员用户名">
                    </div>
                  </div>
                  <div class="am-u-sm-12 am-u-md-2">
                    <div class="am-form-group">
                      <select data-am-selected="{btnSize: 'sm'}" name="status">
                        <option value="2" <php>if($status == 2) echo 'selected'</php>>待审核</option>
                        <option value="1" <php>if($status == 1) echo 'selected'</php>>已完成</option>
                        <option value="3" <php>if($status == 3) echo 'selected'</php>>已驳回</option>
                      </select>
                    <!--</div>-->
                <!--</div>-->

                <!-- <div class="am-u-sm-12 am-u-md-2">
                  <div class="am-input-group am-input-group-sm">

                    <span class="am-input-group-btn">
                    <button class="am-btn am-btn-primary" type="submit">搜索</button>
                  </span>
                  </div>
                </div> -->

            </form>
            <style>
                .red{
                    color: red;
                }
            </style>
            <div>
                提币以太坊地址：0xeE7D927A0F94cC61889b029Fc8e7Beb9f137793A----
                钱包USDT剩余: <span class="usdt red"></span>----
                钱包EXUU剩余：<span class="exuu red"></span>
                <br>
                <!--提币OMNI地址：1Jdg9xfqkyM24hJLaUK6b738JST4XyNmwW&#45;&#45;&#45;&#45;-->
                <!--钱包USDT-OMNI剩余：<span class="red">{$omni}</span>-->
            </div>
            <!--<div>-->
                <!--<div>btc余额：{$balance}</div>-->
                <!--<div class="x123">-->
                    <!--复审钱包地址：0xF4aC5D9be4aEa89b4e607752bcBD31D0A7dFfE16-->
                    <!--——ETH余额：<span class="eth_ll"></span>-->
                    <!--——USDT余额： <span class="usdt_ll"></span>-->
                    <!--——dacm余额： <span class="dacm_ll"></span>-->
                <!--</div>-->
                <!--<div class="x123">-->
                    <!--钱包地址：0x35a9FD0Cf8ADc77452E946AFED3518184C2D15D1-->
                    <!--——ETH余额：<span class="eth_ll"></span>-->
                    <!--——USDT余额： <span class="usdt_ll"></span>-->
                    <!--——dacm余额： <span class="dacm_ll"></span>-->
                <!--</div>-->
                <!--<div class="x123">-->
                    <!--钱包地址：0x19A5219F54c436C426a50461Ebc4a68a3B00beD8-->
                    <!--——ETH余额：<span class="eth_ll"></span>-->
                    <!--——USDT余额： <span class="usdt_ll"></span>-->
                    <!--——dacm余额： <span class="dacm_ll"></span>-->
                <!--</div>-->
                <!--<div class="x123">-->
                    <!--钱包地址：0x48211ebc204DaFa0f5FB7AD7b26667F9F7764319-->
                    <!--——ETH余额：<span class="eth_ll"></span>-->
                    <!--——USDT余额： <span class="usdt_ll"></span>-->
                    <!--——dacm余额： <span class="dacm_ll"></span>-->
                <!--</div>-->
                <!--<div class="x123">-->
                    <!--钱包地址：0x28A0D357770AA0fa4C7e9F9e7F6227aBD64EB312-->
                    <!--——ETH余额：<span class="eth_ll"></span>-->
                    <!--——USDT余额： <span class="usdt_ll"></span>-->
                    <!--——dacm余额： <span class="dacm_ll"></span>-->
                <!--</div>-->
                <!--<div class="x123">-->
                    <!--钱包地址：0xA55e379c75E2698a7e542c50D36807e2407dce72-->
                    <!--——ETH余额：<span class="eth_ll"></span>-->
                    <!--——USDT余额： <span class="usdt_ll"></span>-->
                    <!--——dacm余额： <span class="dacm_ll"></span>-->
                <!--</div>-->
                <!--<div class="x123">-->
                    <!--钱包地址：0x9e63f8300C502E037BA66752eDC8e1234C445Ec3-->
                    <!--——ETH余额：<span class="eth_ll"></span>-->
                    <!--——USDT余额： <span class="usdt_ll"></span>-->
                    <!--——dacm余额： <span class="dacm_ll"></span>-->
                <!--</div>-->


            <!--</div>-->

            <!--<button class="am-btn am-btn-primary yijian">一键通过</button>-->
            <span class="auto_value"></span>
            <div class="am-g">
                <div class="am-u-sm-12">
                    <div class="am-form">
                        <table class="am-table am-table-striped am-table-hover table-main">
                            <thead>
                            <tr>
                                <!--<th><input type="checkbox" id="all"></th>-->
                                <th class="table-title">序号</th>
                                <th class="table-set">操作</th>
                                <th class="table-title">用户ID</th>
                                <th class="table-title">用户名</th>
                                <!--<th class="table-title">手机号</th>-->
                                <th class="table-type">币种名称</th>
                                <th class="table-type">提币地址</th>
                                <th class="table-type">提币数量</th>
                                <th class="table-type">实际提币(扣手续费)</th>
                                <th class="table-type">交易hash</th>
                                <!-- <th class="table-type">到账金额</th> -->
                                <th class="table-type">状态</th>
                                <th class="table-type">手续费</th>
                                <th class="table-date am-hide-sm-only">提交时间</th>
                                <th class="table-date am-hide-sm-only">确认时间</th>
                                <!--<th class="table-date am-hide-sm-only">平台钱包</th>-->

                            </tr>
                            </thead>
                            <tbody>
                            <empty name="data">
                                <tr>
                                    <td>暂无数据</td>
                                </tr>
                            </empty>
                            <php>
                                $tixian = C('WITHDRAW_STATUS');
                                $type = C('account_type');
                            </php>
                            <volist name="data" id="vo">
                                <tr>
                                    <!--<td>-->
                                        <!--<if condition="$vo.status eq 2">-->
                                            <!--<input type="checkbox" class="every" id="{$vo.id}" value="{$vo.id}" coin="{$vo.coinname}" n="{$vo.address}" x="{$vo.id}" m="{$vo.amount}">-->
                                        <!--</if>-->
                                    <!--</td>-->
                                    <td>{$vo['id']}</td>
                                    <td>
                                        <if condition="$vo['status'] eq 2">

                                            <!-- 操作BTC -->
                                            <if condition="$vo['status'] eq 2 AND $vo['coinname'] eq btc">

                                                <div class="am-dropdown" data-am-dropdown="">

                                                    <button class="am-btn am-btn-default am-btn-xs am-dropdown-toggle" data-am-dropdown-toggle=""><span class="am-icon-cog"></span> <span class="am-icon-caret-down"></span></button>

                                                    <ul class="am-dropdown-content">

                                                        <li class="tbtc" id="{$vo['id']}"><a href="#">待审核</a></li>

                                                        <li><a href="{:U('doReject',array('id'=>$vo['id'],'status'=>3,'userid'=>$vo['userid'],'amount'=>$vo['ti_amount'],'coinname'=>$vo['coinname']))}">待驳回</a></li>

                                                    </ul>

                                                </div>

                                            </if>

                                            <!-- 操作ETH -->
                                            <if condition="$vo['status'] eq 2 AND $vo['coinname'] eq eth">

                                                <div class="am-dropdown" data-am-dropdown="">

                                                    <button class="am-btn am-btn-default am-btn-xs am-dropdown-toggle" data-am-dropdown-toggle=""><span class="am-icon-cog"></span> <span class="am-icon-caret-down"></span></button>

                                                    <ul class="am-dropdown-content">

                                                        <li class="teth" id="{$vo['id']}" m="{$vo.amount}" n="{$vo.address}" x="{$vo.id}"><a href="#">待审核</a></li>

                                                        <li><a href="{:U('doReject',array('id'=>$vo['id'],'status'=>3,'userid'=>$vo['userid'],'amount'=>$vo['ti_amount'],'coinname'=>$vo['coinname']))}">待驳回</a></li>

                                                    </ul>

                                                </div>

                                            </if>

                                            <!-- 操作USDT -->

                                            <if condition="$vo['status'] eq 2 AND $vo['coinname'] eq usdt">

                                                <div class="am-dropdown" data-am-dropdown="">

                                                    <button class="am-btn am-btn-default am-btn-xs am-dropdown-toggle" data-am-dropdown-toggle=""><span class="am-icon-cog"></span> <span class="am-icon-caret-down"></span></button>

                                                    <ul class="am-dropdown-content">

                                                        <li class="tusdt" id="{$vo['id']}" m="{$vo.amount}" n="{$vo.address}" x="{$vo.id}"><a href="#">待审核</a></li>

                                                        <li><a href="{:U('doReject',array('id'=>$vo['id'],'status'=>3,'userid'=>$vo['userid'],'amount'=>$vo['ti_amount'],'coinname'=>$vo['coinname']))}">待驳回</a></li>

                                                    </ul>

                                                </div>

                                            </if>


                                            <!-- 操作dacm -->

                                            <if condition="$vo['status'] eq 2 AND $vo['coinname'] eq dacm">

                                                <div class="am-dropdown" data-am-dropdown="">

                                                    <button class="am-btn am-btn-default am-btn-xs am-dropdown-toggle" data-am-dropdown-toggle=""><span class="am-icon-cog"></span> <span class="am-icon-caret-down"></span></button>

                                                    <ul class="am-dropdown-content">

                                                        <li class="tdacm" id="{$vo['id']}" m="{$vo.amount}" n="{$vo.address}" x="{$vo.id}"><a href="#">待审核</a></li>

                                                        <li><a href="{:U('doReject',array('id'=>$vo['id'],'status'=>3,'userid'=>$vo['userid'],'amount'=>$vo['ti_amount'],'coinname'=>$vo['coinname']))}">待驳回</a></li>

                                                    </ul>

                                                </div>

                                            </if>

                                            <!-- 操作EXUU -->

                                            <if condition="$vo['status'] eq 2 AND $vo['coinname'] eq exuu">

                                                <div class="am-dropdown" data-am-dropdown="">

                                                    <button class="am-btn am-btn-default am-btn-xs am-dropdown-toggle" data-am-dropdown-toggle=""><span class="am-icon-cog"></span> <span class="am-icon-caret-down"></span></button>

                                                    <ul class="am-dropdown-content">

                                                        <li class="texuu" id="{$vo['id']}" m="{$vo.amount}" n="{$vo.address}" x="{$vo.id}"><a href="#">待审核</a></li>

                                                        <li><a href="{:U('doReject',array('id'=>$vo['id'],'status'=>3,'userid'=>$vo['userid'],'amount'=>$vo['ti_amount'],'coinname'=>$vo['coinname']))}">待驳回</a></li>

                                                    </ul>

                                                </div>

                                            </if>


                                            <!-- 操作USDT-OMNI -->

                                            <if condition="$vo['status'] eq 2 AND $vo['coinname'] eq usdtomni">

                                                <div class="am-dropdown" data-am-dropdown="">

                                                    <button class="am-btn am-btn-default am-btn-xs am-dropdown-toggle" data-am-dropdown-toggle=""><span class="am-icon-cog"></span> <span class="am-icon-caret-down"></span></button>

                                                    <ul class="am-dropdown-content">

                                                        <li class="tusdtomni" id="{$vo['id']}" m="{$vo.amount}" n="{$vo.address}" x="{$vo.id}"><a href="#">待审核</a></li>

                                                        <li><a href="{:U('doReject',array('id'=>$vo['id'],'status'=>3,'userid'=>$vo['userid'],'amount'=>$vo['ti_amount'],'coinname'=>$vo['coinname']))}">待驳回</a></li>

                                                    </ul>

                                                </div>

                                            </if>


                                            <else/>
                                            ---
                                        </if>
                                    </td>
                                    <td>{$vo['userid']}</td>
                                    <td>{$vo['username']}</td>
                                    <!--<td><a href="#">{$vo['phone']}</a></td>-->
                                    <td><a href="#">{$vo['coinname']|strtoupper}</a></td>
                                    <!--<td><a href="#">{$vo['address']}</a></td>-->

                                    <if condition="$vo['coinname'] eq btc">
                                        <td><a href="https://btc.com/{$vo['address']}" target="_blank">
                                        {$vo['address']}</a></td>
                                        <elseif condition="$vo['coinname'] eq usdtomni"/>
                                        <td><a href="https://omniexplorer.info/address/{$vo['address']}" target="_blank">
                                            {$vo['address']}</a></td>
                                        <else />

                                        <td><a href="https://etherscan.io/address/{$vo['address']}" target="_blank">
                                            {$vo['address']}</a></td>
                                    </if>
                                    <td>{$vo['ti_amount']}</td>
                                    <td>{$vo['amount']}</td>

                                    <!-- <td>{$vo['sxf']}</td> -->
                                    <!-- <td>{$vo['amount'] - $vo['sxf']}</td> -->
                                    <if condition="$vo['coinname'] eq btc">
                                        <td><a href="https://btc.com/{$vo['hash']}" target="_blank">
                                        {$vo['hash']}</a></td>
                                     <elseif condition="$vo['coinname'] eq usdtomni"/>
                                        <td><a href="https://omniexplorer.info/tx/{$vo['hash']}" target="_blank">
                                            {$vo['hash']}</a></td>
                                     <else/>
                                        <td><a href="https://etherscan.io/tx/{$vo['hash']}" target="_blank">
                                            {$vo['hash']}</a></td>
                                    </if>
                                    <td>
                                        {$tixian[$vo['status']]}
                                    </td>
                                    <td>{$vo['fee']}</td>
                                    <!-- <td class="am-hide-sm-only">
                                        {$vo['bank_num']}
                                    </td>
                                    <td class="am-hide-sm-only">
                                      {$vo['bank_name']}
                                    </td> -->

                                    <!-- <td class="am-hide-sm-only">
                                      {$vo['bank_tree']}
                                    </td>
                                    <td class="am-hide-sm-only">
                                      {$vo['bank_user']}
                                    </td>
                                    <td class="am-hide-sm-only">
                                      {$vo['weixin']}
                                    </td>
                                    <td class="am-hide-sm-only">
                                      {$vo['zfb']}
                                    </td> -->
                                    <td class="am-hide-sm-only">{$vo['addtime']|date="Y-m-d H:i:s",###}</td>
                                    <if condition="$vo['endtime'] eq 0">
                                        <td class="am-hide-sm-only">---</td>
                                        <else/>

                                        <td class="am-hide-sm-only">{$vo['endtime']|date="Y-m-d H:i:s",###}</td>

                                    </if>

                                    <!--<td>-->

                                        <!--<if condition="$vo['coinname'] eq btc">-->

                                            <!--{$balance}-->

                                            <!--<elseif condition="$vo['coinname'] eq eth" />-->

                                            <!--<span class="eth"></span>-->

                                            <!--<elseif condition="$vo['coinname'] eq usdt" />-->

                                            <!--<span class="usdt"></span>-->

                                            <!--<elseif condition="$vo['coinname'] eq dacm" />-->

                                            <!--<span class="dacm"></span>-->

                                            <!--<elseif condition="$vo['coinname'] eq exuu" />-->

                                            <!--<span class="exuu"></span>-->

                                        <!--</if>-->

                                    <!--</td>-->


                                </tr>
                            </volist>
                            </tbody>
                        </table>
                        <div class="am-cf">
                            共 {$count} 条记录
                            <div class="am-fr">
                                <ul class="am-pagination">
                                    {$page}

                                </ul>
                            </div>
                        </div>
                        <hr/>
                    </div>

                </div>

            </div>
        </div>

        <footer class="admin-content-footer">
            <hr>
            <p class="am-padding-left">© 2020 AllMobilize, Inc. Licensed under MIT license.</p>
        </footer>

    </div>

    <!-- 引入js -->

    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <script type="text/javascript" src="/Public/Home/js/web3.1.js"></script>
    <!--<script src="__PUBLIC__/Admin/js/withdrawcoin.js"></script>-->

    <!-- 查询平台钱包和转账 -->

    <script type="text/javascript">

        $('#all').click(function () {
            // console.log(this.checked);
            // $(".every").attr('checked',this.checked);
            $(".every").prop('checked',this.checked);
        })

        $('.every').click(function () {
            $flag=true;
            $(".every").each(function () {
                if(!this.checked){
                    $flag=false;
                }
            })
            $("#all").prop('checked',$flag);
        })

        $(".yijian").click(function () {
            // alert(123);return false;
            $flag=true;
            if(confirm("确定执行此操作吗")){
                $arr=[];
                $(".every").each(function () {
                    if(this.checked){
                        $arr.push($(this).val());
                        // alert($(this).attr('n'));
                        if($(this).attr('coin')=='dacm'){
                            tdacm($(this));
                        }
                        if($(this).attr('coin')=='btc'){
                            // tdacm();
                            tbtc($(this));
                        }
                        if($(this).attr('coin')=='eth'){
                            // tdacm();
                            teth($(this));
                        }
                        if($(this).attr('coin')=='usdt'){
                            // tdacm();
                            tusdt($(this));
                        }
                    }
                });
                if($flag==true){
                    alert('批量审核已完成');
                    window.location.reload();
                }else {
                    alert('部分会员审核未通过，请手动驳回');
                    window.location.reload();
                }
                // window.location.reload();
                // alert($arr+"||"+$flag);
                // $.ajax({
                //     type:"post",
                //     dataType:"json",
                //     url:"{:U('yijian_sure')}",
                //     data:{
                //         arr:$arr,
                //     },
                //     success:function (data) {
                //         if(data.code>0){
                //             alert(data.message);
                //             window.location.reload();
                //         }else {
                //             alert(data.message);
                //         }
                //     }
                // })
            }

        })
        

        if (typeof web3 !== 'undefined') {
            web3 = new Web3(web3.currentProvider);
        }
        else {
            web3 = new Web3('https://mainnet.infura.io/JLEYzEEavNnSni91CvPF');
        }

        //循环查每个钱包的eth余额
        $eth_ll='';
        $address_arr=["0xF4aC5D9be4aEa89b4e607752bcBD31D0A7dFfE16","0x35a9FD0Cf8ADc77452E946AFED3518184C2D15D1","0x19A5219F54c436C426a50461Ebc4a68a3B00beD8","0x48211ebc204DaFa0f5FB7AD7b26667F9F7764319","0x28A0D357770AA0fa4C7e9F9e7F6227aBD64EB312","0xA55e379c75E2698a7e542c50D36807e2407dce72","0x9e63f8300C502E037BA66752eDC8e1234C445Ec3"];
        $eth_arr=document.getElementsByClassName('eth_ll');
       for($i=0;$i<$eth_arr.length;$i++){
           (function($i){
               web3.eth.getBalance($address_arr[$i], function(err, resp){
                   if(!err){
                           $eth_ll = web3.utils.fromWei(resp, 'ether');
                           // console.log($eth_ll);
                           $(".eth_ll").eq($i).text($eth_ll);
                   }else{
                       console.log(err);
                   }
               });
           })($i);

       }
        // web3.eth.getBalance($address_arr[0], function(err, resp){
        //     if(!err){
        //         $eth_ll = web3.utils.fromWei(resp, 'ether');
        //         $(".eth_ll").eq(0).append($eth_ll);
        //     }else{
        //         console.log(err);
        //     }
        // });
        // web3.eth.getBalance($address_arr[1], function(err, resp){
        //     if(!err){
        //         $eth_ll = web3.utils.fromWei(resp, 'ether');
        //         $(".eth_ll").eq(1).append($eth_ll);
        //     }else{
        //         console.log(err);
        //     }
        // });
        // web3.eth.getBalance($address_arr[2], function(err, resp){
        //     if(!err){
        //         $eth_ll = web3.utils.fromWei(resp, 'ether');
        //         $(".eth_ll").eq(2).append($eth_ll);
        //     }else{
        //         console.log(err);
        //     }
        // });
        // web3.eth.getBalance($address_arr[3], function(err, resp){
        //     if(!err){
        //         $eth_ll = web3.utils.fromWei(resp, 'ether');
        //         $(".eth_ll").eq(3).append($eth_ll);
        //     }else{
        //         console.log(err);
        //     }
        // });
        // web3.eth.getBalance($address_arr[4], function(err, resp){
        //     if(!err){
        //         $eth_ll = web3.utils.fromWei(resp, 'ether');
        //         $(".eth_ll").eq(4).append($eth_ll);
        //     }else{
        //         console.log(err);
        //     }
        // });
        // web3.eth.getBalance($address_arr[5], function(err, resp){
        //     if(!err){
        //         $eth_ll = web3.utils.fromWei(resp, 'ether');
        //         $(".eth_ll").eq(5).append($eth_ll);
        //     }else{
        //         console.log(err);
        //     }
        // });
        // web3.eth.getBalance($address_arr[6], function(err, resp){
        //     if(!err){
        //         $eth_ll = web3.utils.fromWei(resp, 'ether');
        //         $(".eth_ll").eq(6).append($eth_ll);
        //     }else{
        //         console.log(err);
        //     }
        // });



        // var address = "0x5F19Baa54Cd1e887dFe86Db9b14dC137bE94b88D";
        var address = "0xeE7D927A0F94cC61889b029Fc8e7Beb9f137793A";

        //查询eth余额
        var eth = '';
        web3.eth.getBalance(address, function(err, resp){
            if(!err){
                eth = web3.utils.fromWei(resp, 'ether');
                $(".eth").append(eth);
            }else{
                console.log(err);
            }
        });

//循环查每个钱包usdt的余额
        $usdt_arr=document.getElementsByClassName('usdt_ll');
        for($i=0;$i<$usdt_arr.length;$i++){
            (function ($i) {
                var usdtContractAddress1 = '0xdac17f958d2ee523a2206206994597c13d831ec7';
                var usdtContract1 = new web3.eth.Contract([{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_upgradedAddress","type":"address"}],"name":"deprecate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"deprecated","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_evilUser","type":"address"}],"name":"addBlackList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradedAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maximumFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_maker","type":"address"}],"name":"getBlackListStatus","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowed","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newBasisPoints","type":"uint256"},{"name":"newMaxFee","type":"uint256"}],"name":"setParams","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"issue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"redeem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"basisPointsRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isBlackListed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_clearedUser","type":"address"}],"name":"removeBlackList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MAX_UINT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_blackListedUser","type":"address"}],"name":"destroyBlackFunds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_initialSupply","type":"uint256"},{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_decimals","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Issue","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newAddress","type":"address"}],"name":"Deprecate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"feeBasisPoints","type":"uint256"},{"indexed":false,"name":"maxFee","type":"uint256"}],"name":"Params","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_blackListedUser","type":"address"},{"indexed":false,"name":"_balance","type":"uint256"}],"name":"DestroyedBlackFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_user","type":"address"}],"name":"AddedBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_user","type":"address"}],"name":"RemovedBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"}], usdtContractAddress1, {
                    from : $address_arr[$i]
                });

                var usdt1 = '';

                usdtContract1.methods.balanceOf($address_arr[$i]).call(function(err, tkns){
                    if (!err) {
                        usdt1 = web3.utils.fromWei(tkns, 'mwei');
                        $(".usdt_ll").eq($i).append(usdt1);
                    }else{
                        console.log(err)
                    }

                })
            })($i);

        }


        //查询usdt余额
        var usdtContractAddress = '0xdac17f958d2ee523a2206206994597c13d831ec7';
        var usdtContract = new web3.eth.Contract([{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_upgradedAddress","type":"address"}],"name":"deprecate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"deprecated","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_evilUser","type":"address"}],"name":"addBlackList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradedAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maximumFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_maker","type":"address"}],"name":"getBlackListStatus","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowed","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newBasisPoints","type":"uint256"},{"name":"newMaxFee","type":"uint256"}],"name":"setParams","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"issue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"redeem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"basisPointsRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isBlackListed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_clearedUser","type":"address"}],"name":"removeBlackList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MAX_UINT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_blackListedUser","type":"address"}],"name":"destroyBlackFunds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_initialSupply","type":"uint256"},{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_decimals","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Issue","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newAddress","type":"address"}],"name":"Deprecate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"feeBasisPoints","type":"uint256"},{"indexed":false,"name":"maxFee","type":"uint256"}],"name":"Params","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_blackListedUser","type":"address"},{"indexed":false,"name":"_balance","type":"uint256"}],"name":"DestroyedBlackFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_user","type":"address"}],"name":"AddedBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_user","type":"address"}],"name":"RemovedBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"}], usdtContractAddress, {
            from : '0xeE7D927A0F94cC61889b029Fc8e7Beb9f137793A'
        });

        var usdt = '';

        usdtContract.methods.balanceOf(address).call(function(err, tkns){
            if (!err) {
                usdt = web3.utils.fromWei(tkns, 'mwei');
                $(".usdt").append(usdt);
            }else{
                console.log(err)
            }

        })

        //循环查每个钱包的dacm余额

        // var dacmContractAddress1 = '0xba1ed22c69ad00739ee2b4abd70e270be9e87ee2';
        // var dacmContract1 = new web3.eth.Contract([{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setTransferAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"mintingFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"setReleaseAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"receiver","type":"address"},{"name":"amount","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"burnAmount","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"mintAgents","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setMintAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"upgrade","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"}],"name":"setTokenInformation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradeAgent","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"releaseTokenTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradeMaster","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setLockAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"fromWhom","type":"address"}],"name":"transferToOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getUpgradeState","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"transferAgents","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"released","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"canUpgrade","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"lockAddresses","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalUpgraded","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"releaseAgent","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"agent","type":"address"}],"name":"setUpgradeAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isToken","outputs":[{"name":"weAre","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"BURN_ADDRESS","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"master","type":"address"}],"name":"setUpgradeMaster","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_initialSupply","type":"uint256"},{"name":"_decimals","type":"uint256"},{"name":"_mintable","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"fromWhom","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"OwnerReclaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newName","type":"string"},{"indexed":false,"name":"newSymbol","type":"string"}],"name":"UpdatedTokenInformation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Upgrade","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"agent","type":"address"}],"name":"UpgradeAgentSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"addr","type":"address"},{"indexed":false,"name":"state","type":"bool"}],"name":"MintingAgentChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"receiver","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"burner","type":"address"},{"indexed":false,"name":"burnedAmount","type":"uint256"}],"name":"Burned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}], dacmContractAddress1, {
        //     from : "0x35a9FD0Cf8ADc77452E946AFED3518184C2D15D1"
        // });
        //
        // var dacm1 = '';
        // dacmContract1.methods.balanceOf("0x35a9FD0Cf8ADc77452E946AFED3518184C2D15D1").call(function(err, tkns){
        //     if (!err) {
        //         dacm1 = web3.utils.fromWei(tkns, 'ether');
        //         console.log(dacm1);
        //         $(".dacm_ll").eq(1).append(dacm1);
        //     }else{
        //         console.log(err)
        //     }
        //
        // })




        $dacm_arr=document.getElementsByClassName('dacm_ll');
        for($i=0;$i<$dacm_arr.length;$i++){
            (function ($i) {
                var dacmContractAddress1 = '0xe177dcd5a62485bb6ddbcbcc71852575d5b47512';
                var dacmContract1 = new web3.eth.Contract([{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setTransferAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"mintingFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"setReleaseAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"receiver","type":"address"},{"name":"amount","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"burnAmount","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"mintAgents","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setMintAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"upgrade","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"}],"name":"setTokenInformation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradeAgent","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"releaseTokenTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradeMaster","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setLockAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"fromWhom","type":"address"}],"name":"transferToOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getUpgradeState","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"transferAgents","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"released","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"canUpgrade","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"lockAddresses","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalUpgraded","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"releaseAgent","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"agent","type":"address"}],"name":"setUpgradeAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isToken","outputs":[{"name":"weAre","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"BURN_ADDRESS","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"master","type":"address"}],"name":"setUpgradeMaster","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_initialSupply","type":"uint256"},{"name":"_decimals","type":"uint256"},{"name":"_mintable","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"fromWhom","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"OwnerReclaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newName","type":"string"},{"indexed":false,"name":"newSymbol","type":"string"}],"name":"UpdatedTokenInformation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Upgrade","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"agent","type":"address"}],"name":"UpgradeAgentSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"addr","type":"address"},{"indexed":false,"name":"state","type":"bool"}],"name":"MintingAgentChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"receiver","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"burner","type":"address"},{"indexed":false,"name":"burnedAmount","type":"uint256"}],"name":"Burned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}], dacmContractAddress1, {
                    from : $address_arr[$i]
                });

                var dacm1 = '';
                dacmContract1.methods.balanceOf($address_arr[$i]).call(function(err, tkns){
                    if (!err) {
                        dacm1 = web3.utils.fromWei(tkns, 'ether');
                        console.log(dacm1);
                        $(".dacm_ll").eq($i).append(dacm1);
                    }else{
                        console.log(err)
                    }

                })
            })($i);
        }


        //查询dacm余额
        var dacmContractAddress = '0xe177dcd5a62485bb6ddbcbcc71852575d5b47512';
        var dacmContract = new web3.eth.Contract([{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setTransferAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"mintingFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"setReleaseAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"receiver","type":"address"},{"name":"amount","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"burnAmount","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"mintAgents","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setMintAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"upgrade","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"}],"name":"setTokenInformation","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradeAgent","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"releaseTokenTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradeMaster","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"},{"name":"state","type":"bool"}],"name":"setLockAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"fromWhom","type":"address"}],"name":"transferToOwner","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getUpgradeState","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"transferAgents","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"released","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"canUpgrade","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"lockAddresses","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalUpgraded","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"releaseAgent","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"agent","type":"address"}],"name":"setUpgradeAgent","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isToken","outputs":[{"name":"weAre","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"BURN_ADDRESS","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"master","type":"address"}],"name":"setUpgradeMaster","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_initialSupply","type":"uint256"},{"name":"_decimals","type":"uint256"},{"name":"_mintable","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"fromWhom","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"OwnerReclaim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newName","type":"string"},{"indexed":false,"name":"newSymbol","type":"string"}],"name":"UpdatedTokenInformation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Upgrade","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"agent","type":"address"}],"name":"UpgradeAgentSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"addr","type":"address"},{"indexed":false,"name":"state","type":"bool"}],"name":"MintingAgentChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"receiver","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Minted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"burner","type":"address"},{"indexed":false,"name":"burnedAmount","type":"uint256"}],"name":"Burned","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}], dacmContractAddress, {
            from : '0x77B8Fe8bE70228D10EE786128dFAc242ff32D39A'
        });

        var dacm = '';
        dacmContract.methods.balanceOf(address).call(function(err, tkns){
            if (!err) {
                dacm = web3.utils.fromWei(tkns, 'ether');
                $(".dacm").append(dacm);
            }else{
                console.log(err)
            }

        })


        //查询EXUU余额
        var exuuContractAddress = '0xa4c23a3ab707ef42c004c7e8fadf49c7448e237a';
        var exuuContract = new web3.eth.Contract([{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"},{"name":"_extraData","type":"bytes"}],"name":"approveAndCall","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_initialAmount","type":"uint256"},{"name":"_tokenName","type":"string"},{"name":"_decimalUnits","type":"uint8"},{"name":"_tokenSymbol","type":"string"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":false,"stateMutability":"nonpayable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_from","type":"address"},{"indexed":true,"name":"_to","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_owner","type":"address"},{"indexed":true,"name":"_spender","type":"address"},{"indexed":false,"name":"_value","type":"uint256"}],"name":"Approval","type":"event"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"version","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"}], exuuContractAddress, {
            from : '0xeE7D927A0F94cC61889b029Fc8e7Beb9f137793A'
        });

        var exuu = '';
        exuuContract.methods.balanceOf(address).call(function(err, tkns){
            if (!err) {
                exuu = web3.utils.fromWei(tkns, 'ether');
                $(".exuu").append(exuu);
            }else{
                console.log(err)
            }

        })


        //btc转账
        $('.tbtc').click(function(event) {

            // alert('暂未开放！');
            // return false;

            if(confirm("确认操作？")){

                var id = $(this).attr('id');

                $.ajax({
                    type: 'POST',
                    url: '{:U("doWithdrawBTC")}',
                    data: {
                        'id':id
                    },

                    dataType: 'json',

                    success: function(data){
                        if (data.code == 0) {
                            alert(data.msg);
                            window.location.reload();
                            return;
                        } else {
                            alert(data.msg);
                            window.location.reload();
                            // window.location ="{:U('withdrawCoin')}";
                        }

                    }
                });

            }
            else
            {
                return;
            }
        });

        //usdt-omni转账
        $('.tusdtomni').click(function () {
            if(confirm("确认操作？")){

                var id = $(this).attr('id');

                $.ajax({
                    type: 'POST',
                    url: '{:U("doWithdrawUSDTOMNI")}',
                    data: {
                        'id':id
                    },

                    dataType: 'json',

                    success: function(data){
                        if (data.code == 0) {
                            alert(data.msg);
                            window.location.reload();
                            return;
                        } else {
                            alert(data.msg);
                            window.location.reload();
                            // window.location ="{:U('withdrawCoin')}";
                        }

                    }
                });

            }
            else
            {
                return;
            }
        })

        //eth转账
        $('.teth').click(function(){

            // alert('暂未开放！');
            // return false;

            if(confirm("确认操作？")){

                var from = '0xF4aC5D9be4aEa89b4e607752bcBD31D0A7dFfE16';
                var amount = parseFloat($(this).attr("m"));
                var number = parseFloat($(this).attr("m"));
                var to = $(this).attr("n");
                var id = $(this).attr('x');

                if(!web3.utils.isAddress(to)){
                    alert('ETH钱包地址不正确');
                    return false;
                }

                web3.eth.getBalance(from, function(err, resp){
                    if(!err){

                        balance = web3.utils.fromWei(resp, 'ether');
                        console.log(balance);
                        web3.eth.getGasPrice(function(err, res){
                            if(!err)
                            {
                                price = web3.utils.fromWei(res, 'ether');
                                //console.log(price);
                                limit = 26000;
                                fee = parseFloat(price) * limit;
                                //console.log(fee);
                                //console.log(number);
                                num = parseFloat(fee) + parseFloat(number);
                                //console.log(fee);
                                //console.log(number);
                                //console.log(num);
                                if(parseFloat(num) > parseFloat(balance))
                                {
                                    alert('平台钱包ETH余额不足');
                                    return false;
                                }
                            }
                        });

                    }else{
                        console.log(err);
                    }
                });

                web3.eth.getTransactionCount(from, function(err, count){
                    if(!err){

                        var tcount = count;
                        amount = web3.utils.toWei(amount.toString());
                        web3.eth.getGasPrice().then(function(gasPrice){
                            var rawTransaction = {
                                "from": from,
                                "nonce": "0x" + tcount.toString(16),
                                "gasPrice": web3.utils.toHex(gasPrice),
                                "gasLimit": web3.utils.toHex(26000),
                                "to": to,
                                "value": amount,
                                "data": ''
                            };

                            var privKey = '0x54C9FC6CF41F649863E6AFAC511E418D7A70E814814598FE5C6634326DCEC791';

                            web3.eth.accounts.signTransaction(rawTransaction, privKey, function(err,signed){
                                if(err){
                                    console.log(err);
                                    return ;
                                }
                                web3.eth.sendSignedTransaction(signed.rawTransaction, function(err, result){
                                    if(!err){
                                        console.log(result);
                                        //传送数据
                                        $.ajax({
                                            type: 'POST',
                                            url: '{:U("doWithdrawETH")}',
                                            data: {
                                                'txhash': result,
                                                'id' : id
                                            },
                                            dataType: 'json',

                                            success: function(data){
                                                if (data.code == 0) {
                                                    alert(data.msg);
                                                    window.location.reload();
                                                    // window.location ="{:U('withdrawCoin')}";
                                                } else {
                                                    alert(data.msg);
                                                    return;
                                                }

                                            }
                                        });
                                    }else{
                                        console.log(err);
                                    }
                                })
                            })

                        })

                    }else{
                        console.log(error);
                    }
                });

            }
            else
            {
                return;
            }

        });


        //usdt转账
        $('.tusdt').click(function(){

            // alert('暂未开放！');
            // return false;

            if(confirm("确认操作？")){

                var from = '0xeE7D927A0F94cC61889b029Fc8e7Beb9f137793A';
                var amount = parseFloat($(this).attr("m"));

                // var amount = parseFloat(2000);
                var to = $(this).attr("n");
                var id = $(this).attr('x');

                //验证数量
                if(!web3.utils.isAddress(to)){
                    alert('钱包地址不正确');
                    return false;
                }

                web3.eth.getTransactionCount(from, function(err, count){

                    if(!err){
                        var tcount = count;
                        usdtContract.methods.balanceOf(from).call( function(err, tkns){
                            if (!err) {
                                var balance = web3.utils.fromWei(tkns, 'mwei');
                                console.log(balance);
                                var b = new web3.utils.BN(balance)

                                console.log(b.toNumber());
                                if(parseFloat(balance) < amount){
                                    alert('平台钱包USDT余额不足');
                                    return false;
                                }

                                // return false;
                                amount = web3.utils.toWei(amount.toString(), 'mwei');

                                web3.eth.getGasPrice().then(function(gasPrice){

                                    var rawTransaction = {
                                        "from": from,
                                        "nonce": "0x" + tcount.toString(16),
                                        "gasPrice": web3.utils.toHex(gasPrice),
                                        "gasLimit": web3.utils.toHex(60000),
                                        "to": usdtContractAddress,
                                        "value": "0x0",
                                        "data": usdtContract.methods.transfer(to, amount).encodeABI()
                                    };

                                    // var privKey = '0x54C9FC6CF41F649863E6AFAC511E418D7A70E814814598FE5C6634326DCEC791';
                                    var privKey = '0xb9dbc7e35b0d641ae316aa6ed82bf59c7aebb89333bdf1550c4803762dd5c5c7';

                                    web3.eth.accounts.signTransaction(rawTransaction, privKey, function(err,signed){

                                        if(err){
                                            console.log(err);
                                            return ;
                                        }

                                        web3.eth.sendSignedTransaction(signed.rawTransaction, function(err, result){
                                            if(!err){
                                                //传送数据
                                                $.ajax({
                                                    type: 'POST',
                                                    url: '{:U("doWithdrawETH")}',
                                                    data: {
                                                        'txhash': result,
                                                        'id' : id
                                                    },
                                                    dataType: 'json',

                                                    success: function(data){

                                                        if (data.code == 0) {
                                                            alert(data.msg);
                                                            window.location.reload();
                                                            // window.location ="{:U('withdrawCoin')}";
                                                        } else {
                                                            alert(data.msg);
                                                            return;
                                                        }

                                                    }
                                                });
                                            }else{
                                                console.log(err);
                                            }
                                        })
                                    })

                                })

                            }else{
                                console.log(err)
                            }

                        })
                    }else{
                        console.log(error);
                    }

                });
            }
            else
            {
                return;
            }

        });

        //dacm转账
        $('.tdacm').click(function(){

            //alert('暂未开放！');
            //return false;

            if(confirm("确认操作？")){

                var from = '0x77B8Fe8bE70228D10EE786128dFAc242ff32D39A';
                var amount = parseFloat($(this).attr("m"));

                var to = $(this).attr("n");
                var id = $(this).attr('x');

                //验证数量
                if(!web3.utils.isAddress(to)){
                    alert('钱包地址不正确');
                    return false;
                }

                web3.eth.getTransactionCount(from, function(err, count){

                    if(!err){
                        var tcount = count;
                        dacmContract.methods.balanceOf(from).call( function(err, tkns){
                            if (!err) {
                                var balance = web3.utils.fromWei(tkns, 'ether');
                                console.log(balance);
                                var b = new web3.utils.BN(balance)

                                if(b.toNumber() < amount){
                                    alert('平台钱包dacm余额不足');
                                    return false;
                                }

                                amount = web3.utils.toWei(amount.toString());

                                web3.eth.getGasPrice().then(function(gasPrice){

                                    var rawTransaction = {
                                        "from": from,
                                        "nonce": "0x" + tcount.toString(16),
                                        "gasPrice": web3.utils.toHex(gasPrice),
                                        "gasLimit": web3.utils.toHex(60000),
                                        "to": dacmContractAddress,
                                        "value": "0x0",
                                        "data": dacmContract.methods.transfer(to, amount).encodeABI()
                                    };

                                    var privKey = '3f64639de2f56f534028271491b14ad640b988c68c9f5ddba538f192f05593f0';

                                    web3.eth.accounts.signTransaction(rawTransaction, privKey, function(err,signed){

                                        if(err){
                                            console.log(err);
                                            return ;
                                        }

                                        web3.eth.sendSignedTransaction(signed.rawTransaction, function(err, result){
                                            if(!err){
                                                //传送数据
                                                $.ajax({
                                                    type: 'POST',
                                                    url: '{:U("doWithdrawETH")}',
                                                    data: {
                                                        'txhash': result,
                                                        'id' : id
                                                    },
                                                    dataType: 'json',

                                                    success: function(data){
                                                        //提币失败
                                                        if (data.code == 0) {
                                                            alert(data.msg);
                                                            window.location.reload();
                                                            // window.location ="{:U('withdrawCoin')}";
                                                        } else {
                                                            alert(data.msg);
                                                            window.location.reload();
                                                            return;
                                                        }

                                                    }
                                                });
                                            }else{
                                                console.log(err);
                                            }
                                        })
                                    })

                                })

                            }else{
                                console.log(err)
                            }

                        })
                    }else{
                        console.log(error);
                    }

                });
            }
            else
            {
                return;
            }

        });

        //EXUU转账
        $('.texuu').click(function(){

            //alert('暂未开放！');
            //return false;

            if(confirm("确认操作？")){

                var from = '0xeE7D927A0F94cC61889b029Fc8e7Beb9f137793A';
                var amount = parseFloat($(this).attr("m"));

                var to = $(this).attr("n");
                var id = $(this).attr('x');

                //验证数量
                if(!web3.utils.isAddress(to)){
                    alert('钱包地址不正确');
                    return false;
                }

                web3.eth.getTransactionCount(from, function(err, count){

                    if(!err){
                        var tcount = count;
                        exuuContract.methods.balanceOf(from).call( function(err, tkns){
                            if (!err) {
                                var balance = web3.utils.fromWei(tkns, 'ether');
                                console.log(balance);
                                var b = new web3.utils.BN(balance)

                                console.log(b.toNumber())
                                if(b.toNumber() < amount){
                                    alert('平台钱包EXUU余额不足');
                                    return false;
                                }


                                // return false;
                                amount = web3.utils.toWei(amount.toString());

                                web3.eth.getGasPrice().then(function(gasPrice){

                                    var rawTransaction = {
                                        "from": from,
                                        "nonce": "0x" + tcount.toString(16),
                                        "gasPrice": web3.utils.toHex(gasPrice),
                                        "gasLimit": web3.utils.toHex(60000),
                                        "to": exuuContractAddress,
                                        "value": "0x0",
                                        "data": exuuContract.methods.transfer(to, amount).encodeABI()
                                    };

                                    // var privKey = '0xD4F454B56C7CA17B9CA187A4968CE4F69A727C497F60604C8C3766C89409C54C';
                                    var privKey = '0xb9dbc7e35b0d641ae316aa6ed82bf59c7aebb89333bdf1550c4803762dd5c5c7';

                                    web3.eth.accounts.signTransaction(rawTransaction, privKey, function(err,signed){

                                        if(err){
                                            console.log(err);
                                            return ;
                                        }

                                        web3.eth.sendSignedTransaction(signed.rawTransaction, function(err, result){

                                            console.log(result);

                                            if(!err){
                                                //传送数据
                                                $.ajax({
                                                    type: 'POST',
                                                    url: '{:U("doWithdrawETH")}',
                                                    data: {
                                                        'txhash': result,
                                                        'id' : id
                                                    },
                                                    dataType: 'json',

                                                    success: function(data){
                                                        //提币失败
                                                        if (data.code == 0) {
                                                            alert(data.msg);
                                                            window.location.reload();
                                                            // window.location ="{:U('withdrawCoin')}";
                                                        } else {
                                                            alert(data.msg);
                                                            window.location.reload();
                                                            return;
                                                        }

                                                    }
                                                });
                                            }else{
                                                console.log(err);
                                            }
                                        })
                                    })

                                })

                            }else{
                                console.log(err)
                            }

                        })
                    }else{
                        console.log(error);
                    }

                });
            }
            else
            {
                return;
            }

        });

        //dacm转账
        function tdacm(obj){
            var from = '0x77B8Fe8bE70228D10EE786128dFAc242ff32D39A';
            var amount = parseFloat(obj.attr("m"));
            var to = obj.attr("n");
            var id = obj.attr('x');
            // alert(to);
            //验证数量

            if(!web3.utils.isAddress(to)){
                alert('钱包地址不正确');
                $flag=false;
                layer.msg(id+"会员钱包地址不正确");
                return true;
            }
            // console.log(web3);
            web3.eth.getTransactionCount(from, function(err, count){

                alert(from);return false;
                if(!err){
                    var tcount = count;
                    dacmContract.methods.balanceOf(from).call( function(err, tkns){
                        if (!err) {
                            var balance = web3.utils.fromWei(tkns, 'ether');
                            console.log(balance);
                            var b = new web3.utils.BN(balance)

                            if(b.toNumber() < amount){
                                alert('平台钱包dacm余额不足');
                                $flag=false;
                                layer.msg(id+"平台钱包dacm余额不足");
                                return true;
                            }

                            // alert('dacm');
                            // return true;
                            amount = web3.utils.toWei(amount.toString());

                            web3.eth.getGasPrice().then(function(gasPrice){

                                var rawTransaction = {
                                    "from": from,
                                    "nonce": "0x" + tcount.toString(16),
                                    "gasPrice": web3.utils.toHex(gasPrice),
                                    "gasLimit": web3.utils.toHex(60000),
                                    "to": dacmContractAddress,
                                    "value": "0x0",
                                    "data": dacmContract.methods.transfer(to, amount).encodeABI()
                                };

                                var privKey = '3f64639de2f56f534028271491b14ad640b988c68c9f5ddba538f192f05593f0';

                                web3.eth.accounts.signTransaction(rawTransaction, privKey, function(err,signed){

                                    if(err){
                                        $flag=false;
                                        // console.log(err);
                                        layer.msg(id+'会员审核不通过');
                                        return true;
                                    }

                                    web3.eth.sendSignedTransaction(signed.rawTransaction, function(err, result){
                                        if(!err){
                                            // alert('没出错');
                                            //传送数据
                                            $.ajax({
                                                type: 'POST',
                                                url: '{:U("doWithdrawETH")}',
                                                data: {
                                                    'txhash': result,
                                                    'id' : id
                                                },
                                                dataType: 'json',

                                                success: function(data){

                                                    if (data.code == 0) {
                                                        // alert(data.msg);
                                                        $flag=false;
                                                        // window.location ="{:U('withdrawCoin')}";
                                                        layer.msg(id+'会员审核不通过');
                                                        return true;
                                                    } else {
                                                        console.log(data.msg);
                                                        // window.location.reload();
                                                        alert(data.msg);
                                                        // return;
                                                    }

                                                }
                                            });
                                        }else{
                                            $flag=false;
                                            layer.msg(id+'会员审核不通过');
                                            return true;
                                            // console.log(err);
                                        }
                                    })
                                })

                            })

                        }else{
                            $flag=false;
                            layer.msg(id+'会员审核不通过');
                            return true;
                            // console.log(err);
                        }

                    })
                }else{
                    $flag=false;
                    layer.msg(id+'会员审核不通过');
                    return true;
                    // console.log(error);
                }

            });
        }

        //btc转账
        function tbtc(obj){
            // alert('btc');
            // return true;
            var id = obj.attr('id');

            $.ajax({
                type: 'POST',
                url: '{:U("doWithdrawBTC")}',
                data: {
                    'id':id
                },

                dataType: 'json',

                success: function(data){
                    if (data.code != 2) {
                        $flag=false;
                        layer.msg(id+'会员审核不通过');
                    } else {
                        window.location.reload();
                    }

                }
            });

        }

        //eth转账
        function teth(obj){
            var from = '0xF4aC5D9be4aEa89b4e607752bcBD31D0A7dFfE16';
            var amount = parseFloat(obj.attr("m"));
            var number = parseFloat(obj.attr("m"));
            var to = obj.attr("n");
            var id = obj.attr('x');

            if(!web3.utils.isAddress(to)){
                // alert('ETH钱包地址不正确');
                $flag=false;
                layer.msg(id+'钱包地址不正确');
                return true;
            }

            web3.eth.getBalance(from, function(err, resp){
                if(!err){

                    balance = web3.utils.fromWei(resp, 'ether');
                    console.log(balance);
                    web3.eth.getGasPrice(function(err, res){
                        if(!err)
                        {
                            price = web3.utils.fromWei(res, 'ether');
                            //console.log(price);
                            limit = 26000;
                            fee = parseFloat(price) * limit;
                            //console.log(fee);
                            //console.log(number);
                            num = parseFloat(fee) + parseFloat(number);
                            //console.log(fee);
                            //console.log(number);
                            //console.log(num);
                            if(parseFloat(num) > parseFloat(balance))
                            {
                                // alert('平台钱包ETH余额不足');
                                $flag=false;
                                layer.msg(id+'会员平台钱包ETH余额不足');
                                return true;
                            }
                        }
                    });

                }else{
                    $flag=false;
                    // console.log(err);
                    layer.msg(id+'会员审核不通过');
                    return true;
                }
            });

            // alert('eth');
            // return true;
            web3.eth.getTransactionCount(from, function(err, count){
                if(!err){

                    var tcount = count;
                    amount = web3.utils.toWei(amount.toString());
                    web3.eth.getGasPrice().then(function(gasPrice){
                        var rawTransaction = {
                            "from": from,
                            "nonce": "0x" + tcount.toString(16),
                            "gasPrice": web3.utils.toHex(gasPrice),
                            "gasLimit": web3.utils.toHex(26000),
                            "to": to,
                            "value": amount,
                            "data": ''
                        };

                        var privKey = '0x54C9FC6CF41F649863E6AFAC511E418D7A70E814814598FE5C6634326DCEC791';

                        web3.eth.accounts.signTransaction(rawTransaction, privKey, function(err,signed){
                            if(err){
                                // console.log(err);
                                $flag=false;
                                layer.msg(id+'会员审核不通过');
                                return true;
                            }
                            web3.eth.sendSignedTransaction(signed.rawTransaction, function(err, result){
                                if(!err){
                                    console.log(result);
                                    //传送数据
                                    $.ajax({
                                        type: 'POST',
                                        url: '{:U("doWithdrawETH")}',
                                        data: {
                                            'txhash': result,
                                            'id' : id
                                        },
                                        dataType: 'json',

                                        success: function(data){
                                            if (data.code == 0) {
                                                $flag=false;
                                                layer.msg(id+'会员审核不通过');
                                                return true;
                                            } else {
                                                window.location.reload();
                                            }

                                        }
                                    });
                                }else{
                                    $flag=false;
                                    // console.log(err);
                                    layer.msg(id+'会员审核不通过');
                                    return true;
                                }
                            })
                        })

                    })

                }else{
                    $flag=false;
                    layer.msg(id+'会员审核不通过');
                    return true;
                    // console.log(error);
                }
            });
        }
        //usdt转账
        function tusdt(obj){
            var from = '0xF4aC5D9be4aEa89b4e607752bcBD31D0A7dFfE16';
            var amount = parseFloat(obj.attr("m"));
            var to = obj.attr("n");
            var id = obj.attr('x');

            //验证数量
            if(!web3.utils.isAddress(to)){
                // alert('钱包地址不正确');
                $flag=false;
                layer.msg(id+'会员钱包地址不正确');
                return true;
            }

            web3.eth.getTransactionCount(from, function(err, count){

                if(!err){
                    var tcount = count;
                    usdtContract.methods.balanceOf(from).call( function(err, tkns){
                        if (!err) {
                            var balance = web3.utils.fromWei(tkns, 'mwei');
                            console.log(balance);
                            var b = new web3.utils.BN(balance)

                            if(b.toNumber() < amount){
                                // alert('平台钱包USDT余额不足');
                                $flag=false;
                                layer.msg(id+'会员平台钱包USDT余额不足');
                                return true;
                            }


                            // alert('usdt');
                            // return true;
                            amount = web3.utils.toWei(amount.toString(), 'mwei');

                            web3.eth.getGasPrice().then(function(gasPrice){

                                var rawTransaction = {
                                    "from": from,
                                    "nonce": "0x" + tcount.toString(16),
                                    "gasPrice": web3.utils.toHex(gasPrice),
                                    "gasLimit": web3.utils.toHex(60000),
                                    "to": usdtContractAddress,
                                    "value": "0x0",
                                    "data": usdtContract.methods.transfer(to, amount).encodeABI()
                                };

                                var privKey = '0x54C9FC6CF41F649863E6AFAC511E418D7A70E814814598FE5C6634326DCEC791';

                                web3.eth.accounts.signTransaction(rawTransaction, privKey, function(err,signed){

                                    if(err){
                                        $flag=false;
                                        // console.log(err);
                                        layer.msg(id+'会员审核不通过');
                                        return true;
                                    }

                                    web3.eth.sendSignedTransaction(signed.rawTransaction, function(err, result){
                                        if(!err){
                                            //传送数据
                                            $.ajax({
                                                type: 'POST',
                                                url: '{:U("doWithdrawETH")}',
                                                data: {
                                                    'txhash': result,
                                                    'id' : id
                                                },
                                                dataType: 'json',

                                                success: function(data){

                                                    if (data.code == 0) {
                                                        // alert(data.msg);
                                                        $flag=false;
                                                        // window.location ="{:U('withdrawCoin')}";
                                                        layer.msg('操作失败');
                                                        // } else {
                                                        //     alert(data.msg);
                                                        //     return;
                                                    }else{
                                                        window.location.reload();
                                                    }

                                                }
                                            });
                                        }else{
                                            layer.msg(id+'会员审核不通过');
                                            // console.log(err);
                                            $flag=false;
                                            return true;
                                        }
                                    })
                                })

                            })

                        }else{
                            // console.log(err)
                            $flag=false;
                            layer.msg(id+'会员审核不通过');
                            return true;
                        }

                    })
                }else{
                    // console.log(error);
                    $flag=false;
                    layer.msg(id+'会员审核不通过');
                    return true;
                }

            });
        }





    </script>

</block>